package cn.enjoy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import zipkin2.server.internal.EnableZipkinServer;

import javax.sql.DataSource;


@SpringBootApplication
@EnableZipkinServer
public class SleuthMain {
    public static void main(String[] args) {
        SpringApplication.run(SleuthMain.class,args);
        System.out.println("Sleuth server 启动了...");
    }
    //注入事务控制器
    @Bean
    public PlatformTransactionManager transactionManager(DataSource dataSource){
        return new DataSourceTransactionManager(dataSource);
    }
}